package com.heima.mapper;
import com.github.pagehelper.Page;
import com.heima.pojo.dto.PageQueryDTO;
import com.heima.pojo.entity.Partner;
import com.heima.pojo.vo.PartnerQueryVO;
import com.heima.pojo.vo.PartnerVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface PartnerMapper {

    @Insert("insert into tb_partner(name,password,contact,mobile,ratio,account,create_time,update_time)" +
            "values (#{name},#{password},#{contact},#{mobile},#{ratio},#{account},#{createTime},#{updateTime})")
    int insert(Partner partner);


    Page<PartnerQueryVO> page(PageQueryDTO pageDTO);

    @Select("select id,name,password,contact,mobile,ratio,account,phone from tb_partner where id=#{id}")
    PartnerVO selectById(Integer id);

    int put(Partner partner);

    @Delete("delete from tb_partner where id=#{id}")
    int del(Integer id);
}
